<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <title>用例结果页</title>
</head>
<body>
<c:import url="casenavit.jsp" charEncoding="UTF-8"/>
<div class="col-sm-3 col-md-8 sidebar">
    <div class="table-responsive">
        <table class="table table-striped">
            <thead>
            <tr>
                <th style="text-align:center">运行id</th>
                <th style="text-align:center">任务名称</th>
                <th style="text-align:center">用例名称</th>
                <th style="text-align:center">运行状态</th>
                <th style="text-align:center">运行时间</th>
                <th style="text-align:center">运行结果</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${runCaseRuntWebs}" var="caseresult">
                <tr>
                    <td style="text-align:center">${caseresult.id}</td>
                    <td style="text-align:center;width:180px; height:51px; word-wrap:break-word; word-break:break-all">
                        ${caseresult.taskname}
                    </td>
                    <td style="text-align:center;width:180px; height:51px; word-wrap:break-word; word-break:break-all">
                        <a href="/case/caseinfo?caseid=${caseresult.caseid}">${caseresult.casename}</a>
                    </td>
                    
                    <c:choose>
                        <c:when test="${caseresult.status == 0}">
                            <c:set value="" var="rescolor" />
                            <c:set value="运行中" var="runstatus" />
                        </c:when>
                        <c:when test="${caseresult.status == 1}">
                            <c:set value="blue" var="rescolor" />
                            <c:set value="运行成功" var="runstatus" />
                        </c:when>
                        <c:otherwise>
                            <c:set value="red" var="rescolor" />
                            <c:set value="运行失败" var="runstatus" />
                        </c:otherwise>
                    </c:choose>
                    <td style="text-align:center;color: ${rescolor}">${runstatus}</td>
                    <fmt:formatDate type="both" value="${caseresult.createtime}" var="createtime" />
                    <td style="text-align:center">${createtime}</td>
                    <td style="text-align:center">
                        <a href="/result/interresult?projectid=${projectid}&caserunid=${caseresult.id}">查看详情</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
    <div>
        <ul class="pagination">
            <c:choose>
                <c:when test="${thispage < 2}">
                    <li class="previous disabled"><a href="#">&laquo;</a></li>
                </c:when>
                <c:otherwise>
                    <li><a href="/result/caseresult?page=${thispage-1}&projectid=${projectid}">&laquo;</a></li>
                </c:otherwise>
            </c:choose>
            <li><a>${thispage}</a></li>
            <li><a href="/result/caseresult?page=${thispage+1}&projectid=${projectid}">&raquo;</a></li>
        </ul>
    </div>
</div>
</body>
</html>
